import { createApp } from "vue";
// import './style.css'
import App from "./App.vue";
import router from "./router";

const app = createApp(App);
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
import "element-plus/dist/index.css";
import Vant from "vant";
import store from "./store";
// import "../src/assets/theme.less";
// import "../src/assets/global.css";
// import "../src/assets/iconfont/iconfont.css"
import "../src/styles/smart-flow-design.less";
import "../src/assets/designer.css";
import "../src/styles/index.scss"
//引入svg
import 'virtual:svg-icons-register'
import svgIcon from "../src/components/SvgIcon/index.vue";
app.component('SvgIcon', svgIcon);

import flow from "../src/components/index";
app.config.globalProperties.$isNotEmpty = function (obj) {
  return obj !== undefined && obj !== null && obj !== "" && obj !== "null";
};
app.config.globalProperties.$getDefalut = function (obj, key, df) {
  return obj === undefined || key === undefined || !this.$isNotEmpty(obj[key])
    ? df
    : obj[key];
};


app.config.globalProperties.$deepCopy = function (obj) {
  return JSON.parse(JSON.stringify(obj));
};

import { GlobalCmComponent } from "codemirror-editor-vue3";
import ElementPlus from 'element-plus'
import './permission'




app.use(ElementPlus)
  .use(router)
  .use(store)
  .use(flow)
  .use(GlobalCmComponent)
  .mount("#app");
